package prog1.serialization;

/**
 * Created with IntelliJ IDEA.
 * User: Roi
 * Date: 09/12/13
 */
public class SerializerFactory {
    /**
     * Creates serializer according to type
     * @param type serializer type to create
     * @return created serializer
     */
    public static ISerializer create(SerializerType type) {
        switch (type) {
            case TEXT:
                return new TextSerializer();
            case XML:
                return new XmlSerializer();
            default:
                return null;
        }
    }
}
